//
//  MPStatus.swift
//  MPSinaWeibo
//
//  Created by DaVinci on 16/4/12.
//  Copyright © 2016年 DaVinci. All rights reserved.
//

import UIKit

class MPStatus: NSObject {
    //微博正文
    var text: String?
    
    //微博创建时间
    var created_at: String?
    
    var id: Int64 = 0
    
    //微博来源
    var source: String?
    
    //用户属性
    var user: MPUser?
    
    init(dict: [String : AnyObject]) {
        
        super.init()
        
        setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forKey key: String) {
        
        if key == "user" {
        
           let dict = value as! [String : AnyObject]
           
            user = MPUser(dict: dict)
            
            return
        }
        
        super.setValue(value, forKey: key)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {}
}
